/*
 * @Author: 徐建辰
 * @Date: 2021-11-04 11:48:14
 * @LastEditTime: 2021-11-04 11:57:01
 * @LastEditors: Please set LastEditors
 * @Description: 城市列表字母索引组件
 */
import React, {memo} from 'react'
import PropTypes from 'prop-types'
import './CitySelector.css'

const AlphaIndex = memo(function AlphaIndex(props) {
  const {alpha, onClickCb} = props
  return (
    <i className="city-index-item" onClick={() => onClickCb(alpha)}>{alpha}</i>
  )
})

AlphaIndex.propTypes = {
  alpha: PropTypes.string.isRequired,
  onClickCb: PropTypes.func.isRequired,
}

export default AlphaIndex

